home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Frameworks
/
TransSkel 3.24
/
Source
/
Positioning Stuff
/
SkelTestRectVis.c
< prev
Wrap
Text File
|
1996-01-17
|
917b
|
38 lines
/*
* SkelTestRectVisible ()
*
* Test whether or not the given rectangle is completely visible on the
* desktop. Done by converting the rectangle to a region, intersecting
* it with the desktop region, and checking whether or not the intersection
* is the same as the rectangle's region.
*
* Result is false if the regions needed for the calculation can't be
* allocated.
*/
# include "TransSkel.h"
pascal Boolean
SkelTestRectVisible (Rect *r)
{
Boolean result = false;
RgnHandle rectRgn;
RgnHandle rgn;
rectRgn = NewRgn ();
if (rectRgn != (RgnHandle) nil)
{
rgn = (RgnHandle) SkelQuery (skelQGrayRgn);
if (rgn != (RgnHandle) nil)
{
RectRgn (rectRgn, r); /* convert rect to region */
SectRgn (rectRgn, rgn, rgn); /* intersect with desktop */
result = EqualRgn (rectRgn, rgn); /* true if completely within */
DisposeRgn (rgn);
}
DisposeRgn (rectRgn);
}
return (result);
}